package Operation;

import Book.BookList;

import java.util.Scanner;

public class FindOperation implements IOperation{
    @Override
    public void work(BookList bookList) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入你要查找的书的名字：");
        String name = input.nextLine();
        for (int i = 0; i < bookList.getUsedSize(); i++){
            if (name.equals(bookList.getBook(i).getName())){
                System.out.println(bookList.getBook(i));
                return;
            }
        }
        System.out.println("未找到该图书！");
    }
}
